package com.tiange.factory;

import com.tiange.base.CashSuper;
import com.tiange.contant.Activities;
import com.tiange.service.CashNormal;
import com.tiange.service.CashRebate;
import com.tiange.service.CashReturn;

public class CashContext {
	
	CashSuper cs = null;
	
	public CashContext(Activities acti) {
		
		switch (acti) {
		case NORMAL:
			cs = new CashNormal();
			break;
			
		case FULL300BACK100:
			cs = new CashReturn("300", "100");
			break;
			
		case REBATE80:
			cs = new CashRebate("0.8");
			break;

		default:
			break;
		}
	}
	
	public double getResult(double money) {
		return cs.acceptCash(money);
	}

}
